<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="vie" xml:lang="vie" xmlns="http://www.w3.org/1999/xhtml" itemscope
	itemtype="http://schema.org/Article"
	xmlns:fb="https://www.facebook.com/2008/fbml">
<head
	prefix="og: http://ogp.me/ns# dayxam: 
                  http://ogp.me/ns/apps/dayxam#">

<?php
echo $this->Html->charset('utf-8');
echo $this->Html->meta('icon.ico','img/icon.ico',array('type' => 'icon'));
//echo $this->Html->meta(array('name' => 'robots', 'content' => 'noindex'));
//keyworld:
if(!isset($metakeyword))$metakeyword=$title_for_layout;
if(!isset($metadescription))$metadescription=$metakeyword;
echo $this->Html->meta('keywords',$metakeyword);
echo $this->Html->meta('description',$metadescription);
echo $this->Html->meta(array('itemprop'=>'name','content'=>$title_for_layout));
echo $this->Html->meta(array('itemprop'=>'description','content'=>$this->Common->cutText($metadescription,150)));
//for fb
echo $this->Html->meta(array('property'=>'og:site_name','content'=>$webConfig['site_name']));
echo $this->Html->meta(array('property'=>'fb:app_id','content'=>'204609776328294'));
if(isset($ogTitle))echo $this->Html->meta(array('property'=>'og:title','content'=>$ogTitle));
if(isset($ogType))echo $this->Html->meta(array('property'=>'og:type','content'=>$ogType));
if(isset($ogUrl))echo $this->Html->meta(array('property'=>'og:url','content'=>$this->Seo->link($ogUrl)));
if(isset($ogImage))echo $this->Html->meta(array('id'=>'metaOpenGraphImage','property'=>'og:image','content'=>$ogImage));
if(isset($ogDescription))echo $this->Html->meta(array('property'=>'og:description','content'=>$ogDescription));



//css
echo $this->Html->css('default');

?>
<link rel="author" href="https://plus.google.com/114666187181394028159?rel=author" />


<!--[if IE]>
        <?php echo $this->Html->css('ie');?>
    <![endif]-->
<?php 
if(isset($css)){
	$cssarr=explode(',', $css);
	foreach($cssarr as $k =>$v)
		echo $this->Html->css($v);
}
//js
echo $this->Html->script('common');
echo $this->Html->script('jquery');
echo $this->Html->script('fbplugin');
//title

echo '<title>'.$title_for_layout.'</title>';
?>

</head>
<body>
	<div id="wrapper_outer">
	  <?php echo $this->element('banners')?>
			<center>
			
			<div style="height:150px;"></div>
			<div id="content">
			
                
				<div id="left">
					<?php echo $content_for_layout;?>
					
					<div class="clear" style="height:5px;"></div>
  <!-- facebook plugin -->
	<div>
	
		<div style="float:left;" class="fb-like" data-href="<?php echo $this->Seo->link($ogUrl);?>" data-send="false" data-layout="button_count" data-show-faces="true"></div><br />		
		<div style="float:left;"><g:plusone size="medium" annotation="bubble"></g:plusone></div>
		<div style="clear:both;height:20px;"></div>
		
		
	</div>	
	
  <div style="height:20px;"></div>
  
  <div class="clear" style="height:40px;"></div>
<div>Từ khoá: <?php foreach(split(',',$metakeyword) as $k=>$v)echo '<span><h3>'.$v.'</h3>,</span>'?></div> 

					
					
				</div>
                <?php echo $this->element('sidebar')?>  
				<div class="clear"></div>	
				<div style="height:30px;"></div>
            </div>
			
			<div id="header">
			<?php echo $this->element('header')?> 
			</div>
			<div class="clear"></div>
            <!-- end of content -->
            <?php echo $this->element('footer')?> 
            <!-- end of footer -->
        <div class="clear"></div>	
		</center>
        <!-- end of wrapper_inner -->
    </div>
    <!-- end of wrapper_outer -->
	<?php echo $this->element('sql_dump');
	//echo $this->Js->writeBuffer();
	?>
	
	<script type="text/javascript">
	
	
	$(function() {	
		var minWidthBanner=<?php echo $webConfig['minWidthBanner']?>;
		if($(window).width()<=(960+minWidthBanner))$('.fixedElement').remove();
		else{
			$el = $('.fixedElement img');
			var bannerWidth=0;
			if((($(window).width()-960)/2)><?php echo $webConfig['maxWidthBanner']?>)
				bannerWidth=<?php echo $webConfig['maxWidthBanner']?>;
			else
				bannerWidth=($(window).width()-960)/2;
			$el.css('width',bannerWidth+'px');
			$('#bannerRight').css('left',($(window).width()-bannerWidth-30)+'px');
		}
		$(window).scroll(function(e){ 
			  $el = $('.fixedElement'); 
			  if ($(this).scrollTop() < 150 ) { 
				  $('.fixedElement').css({'position':'absolute','margin-top': '150px'}); 
				}
			  
			  if ($(this).scrollTop() > 150){ 
			    $('.fixedElement').css({'position':'fixed','margin-top':'0px'}); 
			  } 
			});
	});
	<?php if(Configure::read('debug')==0){?>
//for ga
 

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-39986058-1', 'dayxam.com');
  ga('send', 'pageview');



  <?php }?>

 
  var accessToken=0;
  var uid=0;
  var selfurl='<?php echo $this->Seo->link($ogUrl)?>';
  fbplugin.selfurl=selfurl;
  fbplugin.saveUserDataUrl='<?php echo $this->Seo->link('/fbs/saveuserdata');?>';
  window.fbAsyncInit = function() {
      FB.init({
        appId      : '140962896090053', // App ID
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
      });


      
      FB.getLoginStatus(function(response) {
  		  if (response.status === 'connected') {
  		    // the user is logged in and has authenticated your
  		    // app, and response.authResponse supplies
  		    // the user's ID, a valid access token, a signed
  		    // request, and the time the access token 
  		    // and signed request each expire
  		    fbplugin.uid = response.authResponse.userID;
  		  	fbplugin.accessToken = response.authResponse.accessToken;
  		    //call ajax show user config on this app
  		    $('#fbstatus').load('<?php echo $this->Seo->link('/fbs/loaduserdata');?>'+'/'+fbplugin.uid);
  		    
  		  	
  		  } else if (response.status === 'not_authorized') {
  		    // the user is logged in to Facebook, 
  		    // but has not authenticated your app
    		   
  		  } else {
  		    // the user isn't logged in to Facebook.
  		  }

  		  
  		 });

      

      
    };

   
    
  
  
//facebook like
(function(d){
      var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
      js = d.createElement('script'); js.id = id; js.async = true;
      js.src = "//connect.facebook.net/en_US/all.js";
      d.getElementsByTagName('head')[0].appendChild(js);
    }(document));
  
//google plus
  (function() {
	    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
	    po.src = 'https://apis.google.com/js/plusone.js';
	    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
	  })();

    
</script>

</body>
</html>
